home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{14F9E740-9837-11D1-AD8F-EA2E8FD0173F}#7.1#0"; "ButtnBar.ocx"
- Begin VB.Form frmTest
- Caption = "DevPower Button Bar Example"
- ClientHeight = 7530
- ClientLeft = 4200
- ClientTop = 2595
- ClientWidth = 8715
- Icon = "frmTest.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- ScaleHeight = 502
- ScaleMode = 3 'Pixel
- ScaleWidth = 581
- StartUpPosition = 2 'CenterScreen
- Begin VB.PictureBox SizeBar
- BackColor = &H008080FF&
- BorderStyle = 0 'None
- Height = 6075
- Left = 1785
- MouseIcon = "frmTest.frx":0442
- MousePointer = 99 'Custom
- ScaleHeight = 405
- ScaleMode = 3 'Pixel
- ScaleWidth = 6
- TabIndex = 3
- TabStop = 0 'False
- Top = 120
- Width = 90
- Begin VB.Line lnLightShadow
- BorderColor = &H80000014&
- X1 = 5
- X2 = 5
- Y1 = 333
- Y2 = 286
- End
- Begin VB.Line lnShadow
- BorderColor = &H80000010&
- X1 = 4
- X2 = 4
- Y1 = 182
- Y2 = 286
- End
- End
- Begin VB.PictureBox picMain
- BorderStyle = 0 'None
- Height = 5805
- Left = 1950
- ScaleHeight = 5805
- ScaleWidth = 5700
- TabIndex = 1
- Top = 525
- Width = 5700
- Begin VB.CommandButton cmdNavHistory
- Caption = "History"
- Enabled = 0 'False
- Height = 645
- Left = 2505
- MaskColor = &H00FF00FF&
- Picture = "frmTest.frx":0594
- Style = 1 'Graphical
- TabIndex = 30
- ToolTipText = "New in 1.0.4 - Navigation History"
- Top = 3705
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdNavForward
- Caption = "Foward"
- Enabled = 0 'False
- Height = 645
- Left = 1380
- Picture = "frmTest.frx":0696
- Style = 1 'Graphical
- TabIndex = 28
- ToolTipText = "New in 1.0.4 - Navigation History"
- Top = 3705
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdNavBack
- Caption = "Back"
- Enabled = 0 'False
- Height = 645
- Left = 240
- Picture = "frmTest.frx":0798
- Style = 1 'Graphical
- TabIndex = 27
- ToolTipText = "New in 1.0.4 - Navigation History"
- Top = 3705
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdAddItem
- Caption = "Add Item"
- Height = 645
- Left = 240
- Picture = "frmTest.frx":089A
- Style = 1 'Graphical
- TabIndex = 26
- Top = 2145
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdRelabelItem
- Caption = "Rename Item"
- Height = 645
- Left = 1380
- Picture = "frmTest.frx":0994
- Style = 1 'Graphical
- TabIndex = 25
- Top = 2145
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdRemoveCurrItem
- Caption = "Remove Current"
- Height = 645
- Left = 2505
- Picture = "frmTest.frx":0A8E
- Style = 1 'Graphical
- TabIndex = 24
- Top = 2145
- UseMaskColor = -1 'True
- Width = 1305
- End
- Begin VB.CommandButton cmdRemoveLastItem
- Caption = "Remove Last"
- Height = 645
- Left = 3840
- Picture = "frmTest.frx":0E6A
- Style = 1 'Graphical
- TabIndex = 23
- Top = 2145
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdInsertItem
- Caption = "Insert after Current"
- Height = 510
- Left = 240
- TabIndex = 22
- Top = 2805
- Width = 1110
- End
- Begin VB.CommandButton cmdAddTab
- Caption = "Add Tab"
- Height = 645
- Left = 240
- Picture = "frmTest.frx":1246
- Style = 1 'Graphical
- TabIndex = 21
- Top = 1215
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CheckBox chkEnabled
- Caption = "Current Item Enabled"
- Height = 435
- Left = 1380
- TabIndex = 20
- Top = 2835
- Width = 1815
- End
- Begin VB.CommandButton cmdRemoveTab
- Caption = "Remove Last"
- Height = 645
- Left = 3840
- Picture = "frmTest.frx":1340
- Style = 1 'Graphical
- TabIndex = 18
- Top = 1215
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdRemoveCurrTab
- Caption = "Remove Current"
- Height = 645
- Left = 2505
- Picture = "frmTest.frx":171C
- Style = 1 'Graphical
- TabIndex = 17
- Top = 1215
- UseMaskColor = -1 'True
- Width = 1305
- End
- Begin VB.CommandButton cmdRenameTab
- Caption = "Rename Tab"
- Height = 645
- Left = 1380
- Picture = "frmTest.frx":1AF8
- Style = 1 'Graphical
- TabIndex = 16
- Top = 1215
- UseMaskColor = -1 'True
- Width = 1110
- End
- Begin VB.CommandButton cmdFont
- Caption = "Change Font"
- BeginProperty Font
- Name = "Tahoma"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 336
- Index = 0
- Left = 4050
- TabIndex = 13
- Top = 15
- Width = 1500
- End
- Begin VB.CommandButton cmdFont
- Caption = "Change Font"
- Height = 336
- Index = 1
- Left = 4050
- TabIndex = 12
- Top = 360
- Width = 1500
- End
- Begin VB.CheckBox CheckOptions
- Caption = "Smooth Scrolling"
- Height = 192
- Index = 0
- Left = 1710
- TabIndex = 11
- Top = 30
- Value = 1 'Checked
- Width = 2295
- End
- Begin VB.CheckBox CheckOptions
- Caption = "Always Show First Tab"
- Height = 192
- Index = 4
- Left = 1710
- TabIndex = 10
- Top = 810
- Value = 1 'Checked
- Width = 2295
- End
- Begin VB.CheckBox CheckOptions
- Caption = "Items stay down"
- Height = 192
- Index = 3
- Left = 1710
- TabIndex = 9
- Top = 615
- Value = 1 'Checked
- Width = 2295
- End
- Begin VB.CheckBox CheckOptions
- Caption = "Items move with click"
- Height = 192
- Index = 2
- Left = 1710
- TabIndex = 8
- Top = 420
- Value = 1 'Checked
- Width = 2295
- End
- Begin VB.CheckBox CheckOptions
- Caption = "Play Sounds"
- Height = 192
- Index = 1
- Left = 1710
- TabIndex = 7
- Top = 225
- Value = 1 'Checked
- Width = 2295
- End
- Begin VB.OptionButton opView
- Caption = "Small Icons"
- Height = 210
- Index = 1
- Left = 225
- TabIndex = 6
- Top = 255
- Width = 1404
- End
- Begin VB.OptionButton opView
- Caption = "Large Icons"
- Height = 210
- Index = 0
- Left = 225
- TabIndex = 5
- Top = 30
- Value = -1 'True
- Width = 1425
- End
- Begin VB.Label lblNavigation
- Caption = "Navigation"
- Height = 195
- Left = 15
- TabIndex = 29
- Top = 3450
- Width = 945
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000014&
- Index = 7
- X1 = 0
- X2 = 5715
- Y1 = 4425
- Y2 = 4425
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000010&
- Index = 6
- X1 = 0
- X2 = 5655
- Y1 = 4410
- Y2 = 4410
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000010&
- Index = 5
- X1 = 30
- X2 = 5715
- Y1 = 3405
- Y2 = 3405
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000014&
- Index = 4
- X1 = 30
- X2 = 5775
- Y1 = 3420
- Y2 = 3420
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- Caption = "I T E M S"
- Height = 1080
- Left = 15
- TabIndex = 19
- Top = 2130
- Width = 180
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000010&
- Index = 3
- X1 = -45
- X2 = 5640
- Y1 = 2070
- Y2 = 2070
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000014&
- Index = 2
- X1 = -45
- X2 = 5700
- Y1 = 2085
- Y2 = 2085
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "V I E W"
- Height = 825
- Left = 15
- TabIndex = 15
- Top = 30
- Width = 180
- End
- Begin VB.Label lblTabs
- Alignment = 2 'Center
- Caption = "T A B S"
- Height = 825
- Left = 15
- TabIndex = 14
- Top = 1185
- Width = 180
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000014&
- Index = 1
- X1 = 0
- X2 = 5745
- Y1 = 1125
- Y2 = 1125
- End
- Begin VB.Line lnHoriz
- BorderColor = &H80000010&
- Index = 0
- X1 = 0
- X2 = 5685
- Y1 = 1110
- Y2 = 1110
- End
- Begin VB.Label lblMessages
- Caption = "Events"
- Height = 945
- Left = 15
- TabIndex = 2
- Top = 4545
- Width = 3270
- WordWrap = -1 'True
- End
- End
- Begin DevPowerButtnBar.ButtnBar ButtonBar
- Align = 3 'Align Left
- Height = 7530
- Left = 0
- TabIndex = 0
- TabStop = 0 'False
- Top = 0
- Width = 1680
- _ExtentX = 2963
- _ExtentY = 13282
- _Type = "00007615303F262704031E0E3E646373757B617673137F700067606F706160723E676B7B7B66637376"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ScrollDelay = 200
- SoundItemURL = "C:\WINDOWS\MEDIA\CHORD.WAV"
- SoundTabUpURL = "C:\WINDOWS\MEDIA\Jungle Error.wav"
- SoundTabDownURL = "C:\WINDOWS\MEDIA\Jungle Exclamation.wav"
- TrackNavigation = -1 'True
- NumTabs = 2
- Caption1 = "Outlook Items"
- Enabled1 = -1 'True
- View1 = 0
- Tab1Items = 6
- Tab1Item1Caption= "Button Bar Today"
- Tab1Item1MaskColor= 16711935
- Tab1Item1Picture= "frmTest.frx":1BF2
- Tab1Item1SmallPicture= "frmTest.frx":1F0C
- Tab1Item2Caption= "Inbox"
- Tab1Item2MaskColor= 16711935
- Tab1Item2Picture= "frmTest.frx":245E
- Tab1Item2SmallPicture= "frmTest.frx":2778
- Tab1Item3Caption= "Calendar"
- Tab1Item3MaskColor= 16711935
- Tab1Item3Picture= "frmTest.frx":2CCA
- Tab1Item3SmallPicture= "frmTest.frx":2FE4
- Tab1Item4Caption= "Contacts"
- Tab1Item4MaskColor= 16711935
- Tab1Item4Picture= "frmTest.frx":3536
- Tab1Item5Caption= "Search"
- Tab1Item5MaskColor= 16711935
- Tab1Item5Picture= "frmTest.frx":3850
- Tab1Item5SmallPicture= "frmTest.frx":40A2
- Tab1Item6Caption= "Disabled Item"
- Tab1Item6ToolTip= "This item is disabled..."
- Tab1Item6Enabled= 0 'False
- Tab1Item6MaskColor= 16711935
- Tab1Item6Picture= "frmTest.frx":45F4
- Caption2 = "Empty Tab"
- Enabled2 = -1 'True
- ToolTip2 = "Version 1.0.4 allows independant tool tips!"
- View2 = 0
- End
- Begin VB.Label lblHeader
- BackColor = &H80000010&
- Caption = " Header"
- BeginProperty Font
- Name = "Arial"
- Size = 14.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000005&
- Height = 435
- Left = 1920
- TabIndex = 4
- Top = 15
- Width = 5475
- End
- Begin VB.Image imgNew
- Appearance = 0 'Flat
- Height = 480
- Index = 0
- Left = 1800
- Picture = "frmTest.frx":4E46
- Top = 7005
- Visible = 0 'False
- Width = 480
- End
- Begin VB.Image imgNew
- Appearance = 0 'Flat
- Height = 195
- Index = 1
- Left = 2295
- Picture = "frmTest.frx":5150
- Stretch = -1 'True
- Top = 7140
- Visible = 0 'False
- Width = 195
- End
- Begin VB.Menu m_bb
- Caption = "&Button Bar Items"
- Visible = 0 'False
- Begin VB.Menu m_bbitems
- Caption = "Button Bar Popup Menu"
- Begin VB.Menu m_itemopen
- Caption = "&Open Folder"
- Visible = 0 'False
- End
- Begin VB.Menu m_itemremove
- Caption = "R&emove from Button Bar"
- Visible = 0 'False
- End
- Begin VB.Menu m_itemrename
- Caption = "&Rename Shortcut"
- Visible = 0 'False
- End
- Begin VB.Menu m_sep1
- Caption = "-"
- End
- Begin VB.Menu m_icons
- Caption = "&Large Icons"
- Checked = -1 'True
- Index = 0
- End
- Begin VB.Menu m_icons
- Caption = "&Small Icons"
- Index = 1
- End
- Begin VB.Menu m_sep2
- Caption = "-"
- End
- Begin VB.Menu m_tabadd
- Caption = "&Add New Group"
- End
- Begin VB.Menu m_tabremove
- Caption = "R&emove Group"
- End
- Begin VB.Menu m_tabrename
- Caption = "&Rename Group"
- End
- Begin VB.Menu m_itemproperties
- Caption = "&Properties"
- End
- End
- End
- Attribute VB_Name = "frmTest"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Base 1
- Private iTabClicked As Integer
- Private iItemClicked As Integer
- Private Sub ButtonBar_Click(ByVal iTab As Integer, ByVal iItem As Integer)
- Dim sMessage As String
- iTabClicked = iTab
- iItemClicked = iItem
- If iTab = 0 Then
- sMessage = "General Click"
- Else
- opView(0).Value = (ButtonBar.CurrentView = LargeIcons)
- opView(1).Value = (ButtonBar.CurrentView = SmallIcons)
- If iItem = 0 Then
- sMessage = "Tab '" + ButtonBar.CurrentCaption + "' Clicked - " + CStr(iTab)
- Else
- ButtonBar.CurrentItem = iItem
- chkEnabled.Caption = "Current Item (" + CStr(iItem) + ") Enabled"
- chkEnabled.Value = ButtonBar.CurrentItemEnabled And vbChecked
- sMessage = "Item Clicked - Tab " + CStr(iTab) + ", Item " + CStr(iItem) + " '" + ButtonBar.CurrentItemCaption + "'"
- End If
- End If
- If iItem <> 0 Then lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
- lblMessages.Caption = sMessage
- cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
- cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
- cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
- End Sub
- Private Sub ButtonBar_ItemRenamed(ByVal iTab As Integer, ByVal iItem As Integer)
- lblMessages.Caption = "Item Renamed - Tab " + CStr(iTab) + " Item " + CStr(iItem)
- lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
- End Sub
- Private Sub ButtonBar_RightClick(ByVal iTab As Integer, ByVal iItem As Integer)
- Dim sMessage As String
- iTabClicked = iTab
- iItemClicked = iItem
- If iItem = 0 Then
- sMessage = "Tab Right Clicked - " + CStr(iTab)
- m_tabadd.Visible = True
- m_tabremove.Visible = True
- m_tabrename.Visible = True
- m_itemopen.Visible = False
- m_itemremove.Visible = False
- m_itemrename.Visible = False
- m_itemproperties.Visible = False
- m_sep1.Visible = False
- If ButtonBar.Tabs(iTabClicked).View = LargeIcons Then
- m_icons(0).Checked = True
- m_icons(1).Checked = False
- Else
- m_icons(0).Checked = False
- m_icons(1).Checked = True
- End If
- PopupMenu m_bbitems
- Else
- m_tabadd.Visible = False
- m_tabremove.Visible = False
- m_tabrename.Visible = False
- m_itemopen.Visible = True
- m_itemopen.Enabled = ButtonBar.Tabs(iTab).Items(iItem).Enabled
- m_itemremove.Visible = True
- m_itemrename.Visible = True
- m_itemproperties.Visible = True
- m_sep1.Visible = True
- If ButtonBar.Tabs(iTabClicked).View = LargeIcons Then
- m_icons(0).Checked = True
- m_icons(1).Checked = False
- Else
- m_icons(0).Checked = False
- m_icons(1).Checked = True
- End If
- chkEnabled.Caption = "Current Item (" + CStr(iItem) + ") Enabled"
- chkEnabled.Value = ButtonBar.Tabs(iTab).Items(iItem).Enabled And vbChecked
- sMessage = "Item Right Clicked - Tab " + CStr(iTab) + ", Item " + CStr(iItem) + " '" + ButtonBar.Tabs(iTab).Items(iItem).Caption + "'"
- PopupMenu m_bbitems
- End If
- lblMessages.Caption = sMessage
- End Sub
- Private Sub ButtonBar_ScrollDown(ByVal iTab As Integer)
- lblMessages.Caption = "Scroll Down - " + CStr(iTab)
- End Sub
- Private Sub ButtonBar_ScrollUp(ByVal iTab As Integer)
- lblMessages.Caption = "Scroll Up - " + CStr(iTab)
- End Sub
- Private Sub ButtonBar_TabRenamed(ByVal iTab As Integer)
- lblMessages.Caption = "Tab Renamed - " + CStr(iTab)
- End Sub
- Private Sub CheckOptions_Click(Index As Integer)
- Select Case Index
- Case 0
- ButtonBar.SmoothScroll = (CheckOptions(Index).Value = vbChecked)
- Case 1
- ButtonBar.PlaySounds = (CheckOptions(Index).Value = vbChecked)
- Case 2
- ButtonBar.ItemsMoveWithClick = (CheckOptions(Index).Value = vbChecked)
- Case 3
- ButtonBar.ItemsStayDownWithClick = (CheckOptions(Index).Value = vbChecked)
- Case 4
- ButtonBar.AlwaysShowFirstTab = (CheckOptions(Index).Value = vbChecked)
- End Select
- End Sub
- Private Sub chkEnabled_Click()
- On Error Resume Next
- ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Enabled = chkEnabled.Value And vbChecked
- End Sub
- Private Sub cmdAddTab_Click()
- ButtonBar.AddTab ("Tab " + CStr(ButtonBar.NumTabs + 1))
- End Sub
- Private Sub cmdFont_Click(Index As Integer)
- ButtonBar.Font = cmdFont(Index).Font
- lblHeader.Height = ButtonBar.TabHeight
- SizeBits
- End Sub
- Private Sub cmdNavBack_Click()
- ButtonBar.Navigation.GoBack
- cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
- cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
- cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
- End Sub
- Private Sub cmdNavForward_Click()
- ButtonBar.Navigation.GoForward
- cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
- cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
- cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
- End Sub
- Private Sub cmdNavHistory_Click()
- Dim sHistory As String, sSubStr As String
- Dim lPos As Long, lLastPos As Long
- If ButtonBar.Navigation.Enabled Then
- Load frmHistory
- Set frmHistory.ParentWindow = Me
- sHistory = ButtonBar.Navigation.GetHistoryList
- lLastPos = 1
- Do While lLastPos > 0
- lPos = InStr(lLastPos + 1, sHistory, ",")
- If lPos > 0 Then
- sSubStr = Mid(sHistory, lLastPos, lPos - lLastPos)
- Else
- sSubStr = Mid(sHistory, lLastPos)
- End If
- frmHistory.HistoryList.AddItem Left(sSubStr, InStr(1, sSubStr, ";") - 1)
- If lPos > 0 Then
- lLastPos = lPos + 1
- Else
- lLastPos = 0
- End If
- Loop
- frmHistory.iCurrentPosition = ButtonBar.Navigation.CurrentPosition
- frmHistory.HistoryList.ListIndex = ButtonBar.Navigation.CurrentPosition - 1
- frmHistory.Show vbModal
- cmdNavBack.Enabled = ButtonBar.Navigation.CanGoBack
- cmdNavForward.Enabled = ButtonBar.Navigation.CanGoForward
- cmdNavHistory.Enabled = ButtonBar.Navigation.GetHistoryList <> ""
- End If
- End Sub
- Private Sub cmdRemoveCurrItem_Click()
- lblMessages.Caption = "Item Removed - " + CStr(ButtonBar.RemoveItem(ButtonBar.CurrentTab, ButtonBar.CurrentItem)) + " Items Remaining"
- End Sub
- Private Sub cmdRemoveCurrTab_Click()
- ButtonBar.RemoveTab ButtonBar.CurrentTab
- End Sub
- Private Sub cmdRemoveTab_Click()
- ButtonBar.RemoveLastTab
- End Sub
- Private Sub cmdAddItem_Click()
- lblMessages.Caption = "Item Added - " + CStr(ButtonBar.AddItem(ButtonBar.CurrentTab, "Item " + CStr(ButtonBar.NumItems + 1))) + " in total"
- With ButtonBar.Tabs(ButtonBar.CurrentTab).Items(ButtonBar.NumItems)
- .MaskColor = RGB(192, 192, 192)
- .Picture = imgNew(0).Picture
- .SmallPicture = imgNew(1).Picture
- End With
- End Sub
- Private Sub cmdInsertItem_Click()
- Dim iTab As Integer, iItem As Integer
- iTab = ButtonBar.CurrentTab
- iItem = ButtonBar.CurrentItem
- ButtonBar.Tabs(iTab).Items.Insert iItem, "Item " + CStr(ButtonBar.NumItems + 1)
- lblMessages.Caption = "Item Added - " + CStr(ButtonBar.NumItems) + " in total"
- With ButtonBar.Tabs(iTab).Items(iItem + 1)
- .MaskColor = RGB(192, 192, 192)
- .Picture = imgNew(0).Picture
- .SmallPicture = imgNew(1).Picture
- End With
- End Sub
- Private Sub cmdRemoveLastItem_Click()
- lblMessages.Caption = "Item Removed - " + CStr(ButtonBar.RemoveLastItem(ButtonBar.CurrentTab)) + " Items Remaining"
- End Sub
- Private Sub cmdRelabelItem_Click()
- ButtonBar.RelabelItem ButtonBar.CurrentItem
- End Sub
- Private Sub cmdRenameTab_Click()
- ButtonBar.RelabelTab (ButtonBar.CurrentTab)
- End Sub
- Private Sub Command1_Click()
- MsgBox ButtonBar.Navigation.GetHistoryList
- End Sub
- Private Sub opView_Click(Index As Integer)
- ButtonBar.CurrentView = Index
- End Sub
- Private Sub Form_Load()
- opView(0).Value = (ButtonBar.CurrentView = LargeIcons)
- opView(1).Value = (ButtonBar.CurrentView = SmallIcons)
- CheckOptions(0).Value = ButtonBar.SmoothScroll And vbChecked
- CheckOptions(1).Value = ButtonBar.PlaySounds And vbChecked
- CheckOptions(2).Value = ButtonBar.ItemsMoveWithClick And vbChecked
- CheckOptions(3).Value = ButtonBar.ItemsStayDownWithClick And vbChecked
- CheckOptions(4).Value = ButtonBar.AlwaysShowFirstTab And vbChecked
- chkEnabled.Value = ButtonBar.CurrentItemEnabled And vbChecked
- ' frTab.Caption = "Current Tab (" + CStr(ButtonBar.CurrentTab) + "):"
- lblMessages.Caption = "DevPower ButtnBar Version " + ButtonBar.Version + " (" + ButtonBar.VBVersion + ")"
- ButtonBar.CurrentItem = 1
- iTabClicked = 1
- iItemClicked = 1
- lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
- lnShadow.Y1 = 0
- lnLightShadow.Y1 = 0
- SizeBar.BackColor = vbButtonFace
- SizeBar.Left = ButtonBar.Left + ButtonBar.Width
- SizeBar.ZOrder
- SizeBits
- End Sub
- Private Sub Form_Resize()
- SizeBits
- End Sub
- Private Sub SizeBits()
- SizeBar.Top = 0
- SizeBar.Height = Me.ScaleHeight
- lnShadow.Y2 = SizeBar.Height
- lnLightShadow.Y2 = lnShadow.Y2
- ' Size Header
- lblHeader.Height = ButtonBar.TabHeight
- lblHeader.Top = ButtonBar.Top + 1
- lblHeader.Left = SizeBar.Left + SizeBar.Width
- lblHeader.Width = Me.ScaleWidth - lblHeader.Left
- ' Size Main panel
- picMain.Top = lblHeader.Top + lblHeader.Height
- picMain.Left = SizeBar.Left + SizeBar.Width + 3
- picMain.Width = Me.ScaleWidth - picMain.Left
- picMain.Height = Me.ScaleHeight - picMain.Top
- lnHoriz(0).X2 = picMain.ScaleWidth
- lnHoriz(1).X2 = picMain.ScaleWidth
- lnHoriz(2).X2 = picMain.ScaleWidth
- lnHoriz(3).X2 = picMain.ScaleWidth
- lnHoriz(4).X2 = picMain.ScaleWidth
- lnHoriz(5).X2 = picMain.ScaleWidth
- End Sub
- Private Sub SizeBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = vbLeftButton Then SizeBar.BackColor = vb3DDKShadow
- End Sub
- Private Sub SizeBar_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim L As Long, SW As Long
- If Button = vbLeftButton Then
- L = SizeBar.Left + X
- SW = Me.ScaleWidth
- If (L < 55) Then ' Minimum Size
- L = 55 ' Fix Position
- ElseIf L > (SW - 100 - SizeBar.Width) Then ' Outside Right Of Window
- L = SW - 100 - SizeBar.Width ' Fix Position
- End If
- SizeBar.Left = L
- End If
- End Sub
- Private Sub SizeBar_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim L As Long, w As Long, SW As Long
- Dim L2 As Long, W2 As Long
- With SizeBar
- .BackColor = vbButtonFace
- L = .Left
- w = .Width
- SW = Me.ScaleWidth
-
- If (L < 55) Then ' Minimum Size
- L = 55 ' Fix Position
- .Left = L ' Adjust sizebar position
- ElseIf L > (SW - 100 - w) Then ' Outside Right Of Window
- L = SW - 100 - w ' Fix Position
- .Left = L ' Adjust sizebar position
- End If
-
- ButtonBar.Width = Abs(L - ButtonBar.Left) ' Resize Button Bar Width
- L2 = L + w
- W2 = Abs(SW - L - w)
- End With
- SizeBits
- End Sub
- ' =====================================================
- ' Pop Up Menu Items:
- ' =====================================================
- Private Sub m_icons_Click(Index As Integer)
- ButtonBar.Tabs(iTabClicked).View = Index
- If ButtonBar.CurrentTab = iTabClicked Then opView(Index).Value = True
- End Sub
- Private Sub m_tabadd_Click()
- ButtonBar.RelabelTab ButtonBar.AddTab("New Tab")
- End Sub
- Private Sub m_tabremove_Click()
- If MsgBox("Are you sure you want to remove the specified Tab?", vbExclamation + vbYesNo, "DevPower Button Bar Test Application") = vbYes Then
- ButtonBar.RemoveTab iTabClicked
- End If
- End Sub
- Private Sub m_tabrename_Click()
- ButtonBar.RelabelTab iTabClicked
- End Sub
- Private Sub m_itemopen_Click()
- ButtonBar.CurrentItem = iItemClicked
- lblHeader.Caption = " " + ButtonBar.CurrentItemCaption
- End Sub
- Private Sub m_itemproperties_Click()
- Load frmProperties
- frmProperties.picImage = ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Picture
- frmProperties.lblCaption.Caption = ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Caption
- If ButtonBar.Tabs(iTabClicked).Items(iItemClicked).Enabled Then
- frmProperties.lblEnabled.Caption = "Enabled"
- Else
- frmProperties.lblEnabled.Caption = "Disabled"
- End If
- frmProperties.Show vbModal
- End Sub
- Private Sub m_itemremove_Click()
- If MsgBox("Are you sure you want to remove this shortcut?", vbExclamation + vbYesNo, "DevPower Button Bar Test Application") = vbYes Then
- ButtonBar.RemoveItem ButtonBar.CurrentTab, iItemClicked
- End If
- End Sub
- Private Sub m_itemrename_Click()
- ButtonBar.RelabelItem iItemClicked
- End Sub
-